export default function counterReducer(preState,action){
    const {type,data} = action
    if(type === 'increment'){
        return preState += data
    }
    if(type === 'decrement'){
        return preState -= data
    }
    return 0
}